package com.ttg.web.controller.common;

import com.ttg.common.entities.BaseResult;
import com.ttg.common.utils.RequestParamsManager;
import com.ttg.model.dto.GetBankDataInfoDto;
import com.ttg.model.vo.ResultStatusVo;
import com.ttg.web.service.ManageTagInfoService;
import com.ttg.web.service.VipBankInfoService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangHongYuan
 * @description
 * @date 2023/7/6 14:54
 */
@Api("手动拉取数仓原始数据")
@RestController
@RequestMapping("/vipBank")
public class VipBankInfoController {

    @Autowired
    private VipBankInfoService vipBankInfoService;

    @Autowired
    private ManageTagInfoService manageTagInfoService;
    /**
     * 手动触发读取对公或对私excel文件
     * @param data
     * @return
     */
    @PostMapping("/getBankDataInfo")
   public  BaseResult getBankDataInfo(@RequestBody String data){
        GetBankDataInfoDto getBankDataInfoDto = RequestParamsManager.transformRequestParam(data, GetBankDataInfoDto.class);
        manageTagInfoService.getDataByFileTwo(getBankDataInfoDto.getFilePath(),getBankDataInfoDto.getType());
        return BaseResult.success(new ResultStatusVo("1"));
    }
}
